#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(this,&Widget::mySignal,this,&Widget::handleMySignalg);


}

void Widget::handleMySignalg(const QString& myText1,const QString& myText2)
{
    this->setWindowTitle(myText1+myText2);
//    this->setWindowTitle(myText2);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    //发送自定义信号
    emit mySignal("cf","");
}

void Widget::on_pushButton_2_clicked()
{
    emit mySignal("opop","123");
}
